async function getDays(term0, term1, classId) {
	var [err, res] = await uni.request({
		url: "http://211.82.48.36/student/teachingResources/classCurriculum/searchCurriculumInfo/callback?planCode=" + term0 + term1 +
			"&classCode=" + classId,
		method: "GET",
		header: {
			'Content-Type': 'application/x-www-form-urlencoded'
		},
	})
	if (err) return null
	// console.log(res)
	let days = []
	let content = res.data
	for (let i = 0; i < 7; i++) days.push([])
	let list = content[0]
	console.log(list)
	for (let i = 0; i < list.length; i++) {
		let value = list[i]
		let teacher = value.jsm
		let name = value.kcm
		let startClass = value.id.skjc
		let length = value.cxjc
		let weeks = value.zcsm.split('周')[0]
		let classDay = value.id.skxq
		let startWeek, endWeek;
		if (weeks.indexOf('-') != -1) {
			startWeek = weeks.split('-')[0]
			endWeek = weeks.split('-')[1]
		} else {
			startWeek = weeks.split('第')[1]
			endWeek = startWeek
		}
		startWeek = parseInt(startWeek)
		endWeek = parseInt(endWeek)				
		let where = value.jxlm + value.jasm
		days[classDay].push({
			name,
			teacher,
			startClass,
			length,
			startWeek,
			endWeek,
			where
		})
	}
	console.log(days)
	return kebiaoFormat(days)
}

function kebiaoFormat(e) {
	let zhou = new Array();
	for (let i = 0; i < 7; i++) {
		let tian = new Array(10)
		for (let j = 0; j < 10; j++) tian[j] = new Array()

		for (let k = 0; k < e[i].length; k++) {
			let obj = e[i][k];
			tian[obj.startClass - 1].push(obj)
		}
		zhou.push(tian);
	}

	return zhou;
}


export {
	getDays
}
